package com.zjj.day3.employeeTest2;

/**
 * @author zhoujunjie
 * @desc Employee
 * @date 2025/4/21
 */

public class Test {
    public static void main(String[] args) {
        Employee employee = new Employee("张三","001",10000) {
            @Override
            public void addSalary() {
                this.pay *= 1.1;
            }
        };
        Manager manager = new Manager("李四", "002", 10000, 5000);

        System.out.println("涨薪前：");
        System.out.println("姓名：" + employee.getName());
        System.out.println("工号：" + employee.getId());
        System.out.println("工资：" + employee.getPay());
        employee.addSalary();
        System.out.println("涨薪后：");
        System.out.println("工资：" + employee.getPay());

        System.out.println("涨薪前：");
        System.out.println("姓名：" + manager.getName());
        System.out.println("工号：" + manager.getId());
        System.out.println("工资：" + manager.getPay());
        System.out.println("分红：" + manager.getBonus());

        manager.addSalary();

        System.out.println("涨薪后：");
        System.out.println("工资：" + manager.getPay());
    }
}